package main

import (
	"fmt"
	"strconv"
)

func main() {
	s := "abc"
	b := []byte(s)

	fmt.Println(b[1])
	b[1]=43
	fmt.Println(b[1])
	s2 := string(b)
	fmt.Println(s2)


	x := 123
	y := fmt.Sprintf("%d", x)
	fmt.Println(y, strconv.Itoa(x)) // "123 123"
	//s := fmt.Sprintf("x=%b", x)


	//字符串变成整数
	x, err := strconv.Atoi("123") // x is an int
	fmt.Println(x,err)
	 //y, e := strconv.ParseInt("123", 10, 0)
	 //fmt.Println(y,e)
	 a:="123"
	 c:="123"
	fmt.Println(a==c)
	 m:=[2]int{12,14}
	 n:=[2]int{12,14}
	 t:=m[0:2]
	 //v:=m[0:2]
	 fmt.Println(m==n)
	 fmt.Println(&m)
	 fmt.Println(&m[1]==&t[1])



	var runes []rune
	 for _, r := range "Hello, 世界" {
	 	runes = append(runes, r) }
	 //fmt.Printf(runes) // "['H' 'e' 'l' 'l' 'o' ',' ' ' '世' '界']"
	fmt.Printf("%q\n", runes)
	 fmt.Println(runes)

	 aa:=[]int{1,2,3}
	aa= append(aa, 1, 2)
	fmt.Println(aa)
	e:= new(employee)
	//e.name="ggg"
	////
	//ee:=employee{12,"ff","hh"}

	gg:=employee{11,"34","hhh"}
	sss := &gg
	fmt.Println(&sss)
	//fmt.Println(ee)
	*e=employee{11,"34","hhh"}
	fmt.Println(&e)
	fmt.Println(gg==*e)
	//fmt.Println(gg.id)

}

type employee struct {
	id int
	name string
	address string
}
